package com.fjc.dao;

import com.fjc.domain.SysRolePermission;
import com.fjc.domain.SysRolePermissionExample;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
@Mapper
public interface SysRolePermissionMapper {
    long countByExample(SysRolePermissionExample example);

    int deleteByExample(SysRolePermissionExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(SysRolePermission record);

    int insertSelective(SysRolePermission record);

    List<SysRolePermission> selectByExample(SysRolePermissionExample example);

    SysRolePermission selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") SysRolePermission record, @Param("example") SysRolePermissionExample example);

    int updateByExample(@Param("record") SysRolePermission record, @Param("example") SysRolePermissionExample example);

    int updateByPrimaryKeySelective(SysRolePermission record);

    int updateByPrimaryKey(SysRolePermission record);

    List<Map> selectParentMenuByRoleid(Integer roleid);

    List<Map> selectChildrenMenuByRoleid(@Param("roleid") Integer roleid,@Param("parentid") Integer parentid);

    List<Map> selectNoDelPermissionByRoleid(Integer roleid);

    List<Integer> selectAllPermissionByRoleid(Integer roleid);

    List<Map> selectParentIsNotNull(Integer roleid);
}